package tichu_project252.Controller;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import tichu_project252.Model.Model;

/**
 * Handles the tichu button.
 *
 * <p> <b> Invariants: </b> </p>
 *
 * @author Alexandra Barka, ΑΜ: 2867, login : barka.
 * @author Euaggelia Petauraki AM: 2875 login: petavraki.
 * @version %I%, %G%
 *
 */
public class tichuHandler extends Controller implements ActionListener {

    /**
     * The tichuHandler defines the behavior of the "Tichu" buttons when an
     * action is performed on them.
     *
     * <p><b>Constructor: </b> tichuHandler(Model m)</p>
     *
     *<p><b>Precondition: </b> There is a model </p> <p><b>Postcondition:
     * </b> constructs a valid controller </p>
     *
     * @see <a
     * href="http://docs.oracle.com/javase/tutorial/java/IandI/super.html">super</a>
     *
     */
    public tichuHandler(Model m) {
        super(m);
    }

    /**
     * Invoked when an action occurs.
     * 
     * <p><b>Precondition: </b> The button is pushed </p> 
     * <p><b>Postcondition: </b> The method handleTichu is performed. </p>
     * 
     *@see ActionListener
     */
    @Override
    public void actionPerformed(ActionEvent e) {
       m.handleTichu();
    }
}
